txt = ",,,,,rrttgg.....banana....rrr"

x = txt.strip(",.grt")

print(x)
